<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateBillItemTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_idBillItem}" for="idBillItem" />
                    <h:inputText id="idBillItem" value="#{billItemController.selected.idBillItem}" title="#{bundle.CreateBillItemTitle_idBillItem}" required="true" requiredMessage="#{bundle.CreateBillItemRequiredMessage_idBillItem}"/>
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_itemAmount}" for="itemAmount" />
                    <h:inputText id="itemAmount" value="#{billItemController.selected.itemAmount}" title="#{bundle.CreateBillItemTitle_itemAmount}" />
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_itemPrice}" for="itemPrice" />
                    <h:inputText id="itemPrice" value="#{billItemController.selected.itemPrice}" title="#{bundle.CreateBillItemTitle_itemPrice}" />
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_totalPrice}" for="totalPrice" />
                    <h:inputText id="totalPrice" value="#{billItemController.selected.totalPrice}" title="#{bundle.CreateBillItemTitle_totalPrice}" />
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_itemEXPDate}" for="itemEXPDate" />
                    <h:inputText id="itemEXPDate" value="#{billItemController.selected.itemEXPDate}" title="#{bundle.CreateBillItemTitle_itemEXPDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_packageCount}" for="packageCount" />
                    <h:inputText id="packageCount" value="#{billItemController.selected.packageCount}" title="#{bundle.CreateBillItemTitle_packageCount}" />
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_exportBill}" for="exportBill" />
                    <h:inputText id="exportBill" value="#{billItemController.selected.exportBill}" title="#{bundle.CreateBillItemTitle_exportBill}" />
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_itemID}" for="itemID" />
                    <h:selectOneMenu id="itemID" value="#{billItemController.selected.itemID}" title="#{bundle.CreateBillItemTitle_itemID}" >
                        <f:selectItems value="#{itemController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_factoryID}" for="factoryID" />
                    <h:selectOneMenu id="factoryID" value="#{billItemController.selected.factoryID}" title="#{bundle.CreateBillItemTitle_factoryID}" >
                        <f:selectItems value="#{factoryController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateBillItemLabel_billID}" for="billID" />
                    <h:selectOneMenu id="billID" value="#{billItemController.selected.billID}" title="#{bundle.CreateBillItemTitle_billID}" >
                        <f:selectItems value="#{billController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{billItemController.create}" value="#{bundle.CreateBillItemSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{billItemController.prepareList}" value="#{bundle.CreateBillItemShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateBillItemIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
